
package protocol;

import java.util.List;

import protocol.meta.CheckVersionInfo;
import protocol.meta.RecommAppInfo;
import protocol.meta.Source;
import protocol.meta.Subject;
import protocol.meta.TopicVO;
import protocol.meta.User;
import protocol.meta.UserAdvice;
import protocol.meta.UserDynamic;
import protocol.transactions.XoneBaseTransaction;
import android.os.Handler;

public class XoneCallBack {

    /*************************************************************
     * success
     *************************************************************/
    /**
     * 登录成功
     */
    public void onLogin(int transactionId, User account) {
    }

    /**
     * 检查号码唯一性成功
     */
    public void onCheckPhoneNumber(int transactionId, Boolean available) {
    }

    /**
     * 获取ID和密钥成功
     */
    public void onGetIdKey(int transactionId) {
    }

    /**
     * 获取资讯头条推荐成功
     */
    public void onHeadRecommend(int transactionId, Object obj) {
    }

    /**
     * 获取输入提示关注用户列表成功
     */
    public void onUserInputTipList(int transactionId, Object obj) {
    }

    /**
     * 获取输入提示订阅资讯源列表成功
     */
    public void onSourceInputTipList(int transactionId, Object obj) {
    }

    /**
     * 获取输入提示热门话题列表成功
     */
    public void onTopicInputTipList(int transactionId, Object obj) {
    }

    /**
     * 获取输入提示订阅主题列表成功
     */
    public void onSubjectInputTipList(int transactionId, Object obj) {
    }

    /**
     * 环回成功
     */
    public void onLoopBack(int transactionId, Object obj) {
    }

    /**
     * （订阅）获得主题列表成功
     * @param transactionId
     * @param list
     */
    public void onGetSubjectList(int transactionId, List<Subject> list){

    }
    /**
     * 获取手机验证码成功
     */
    public void onGetCaptcha(int transactionId, String captcha) {
    }
    /**
     * 修改手机登录密码成功
     */
    public void onModifyCellPhonePw(int transactionId) {
    }
    /**
     * 注销成功
     */
    public void onLogout(int transactionId) {
    }
    /**
     * 图片，视频，音频上传成功
     */
    public void onUpload(int transactionId, Object obj) {
    }

    /**
     * 发表讨论成功
     */
    public void onPostDiscuss(int transactionId, Object obj) {
    }

    /**
     * 评论资讯成功
     */
    public void onCommentInfo(int transactionId, Object obj) {
    }

    /**
     * 转发资讯成功
     */
    public void onForwardInfo(int transactionId, Object obj) {
    }

    /**
     * 搜索主题和资讯源成功
     * @param transactionid
     * @param subjectListAndSourceList
     */
    public void onSearchSubjectAndSource(int transactionId, List<Object> subjectListAndSourceList){
    }

    /**
     * 获得最新资讯源
     * @param trasactionId
     * @param sourceList
     */
    public void onGetLatestSourceList(int trasactionId, List<Source> sourceList){
    }
    /**
     * 获取最热主题列表
     *
     */
    public void onGetHotestSubjectList(int trasactionId, List<Subject> subjectList) {
    }
    /**
     * 获取推荐主题列表
     */
    public void onGetRecommedSubjectList(int transactionId, List<Subject> subjectList) {
    }
    /**
     * 批量获取资讯ID
     */
    public void onGetInfoIds(int transactionId, Object obj) {
    }
    /**
     * 获取主题详情
     */
    public void onGetSubjectDetail(int transactionId, Subject subject) {
    }
    /**
     * 获取资讯源详情
     */
    public void onGetSourceDetail(int transactionId, Source source) {
    }
    /**
     * 获取资讯列表
     */
    public void onGetInfoList(int transactionId, Object obj) {
    }
    /**
     * 绑定帐号同步成功
     */
    public void onBindingAccSync(int transactionId) {
    }
    /**
     * 上传反馈日志成功
     */
    public void onPostLog(int transactionId,String fileId){

    }
    /**
     * 反馈成功
     */
    public void onFeedBack(int transactionId){

    }
    /**
     * 订阅成功
     */
    public void onSubscribe(int transactionId, int[] subjectIdAndSourceId){

    }
    /**
     * 取消订阅成功
     */
    public void onUnsubscribe(int transactionId, int sourceId){

    }
    /**
     * 获取资讯正文
     */
    public void onInfoDetail(int transactionId, Object obj) {
    }
    /**
     * 获取资讯评论，转发，赞
     */
    public void onInfoCfp(int transactionId, Object obj) {
    }
    /**
     * 获取应用设置参数成功
     */
    public void onGetAppSetting(int transactionId) {
    }
    /**
     * 获取用户订阅的主题
     */
    public void onGetSubscribeSubjectList(int transactionId, List<Subject> subjectList) {
    }
    /**
     * 获取推荐成功
     */
    public void onGetRecomm(int transactionId, List<RecommAppInfo> list) {
    }
    /**
     * 获取未读资讯条成功
     */
    public void onGetUnReadInfoCount(int transactionId, Object obj) {
    }
    /**
     * 获取版本信息成功
     */
    public void onGetVersionInfo(int transactionId, CheckVersionInfo versionInfo) {
    }
    /**
     * 赞资讯成功
     */
    public void onPraiseInfo(int transactionId, Object obj) {
    }
    /**
     * 获取人气榜用户
     */
    public void onGetPopFriendsList(int transactionId, List<User> userList) {
    }
    /**
     * 获取猜你喜欢的用户
     */
    public void onGetGuessFriendsList(int transactionId, List<User> userList) {
    }
    /**
     * 获取热门话题
     */
    public void onGetTopicList(int transactionId, List<TopicVO> topicList) {
    }
    /**
     * 获取用户信息
     */
    public void onGetUserDetail(int transactionId, User user) {
    }
    /**
     * 获取用户粉丝列表
     */
    public void onGetFansList(int transactionId, List<User> userList){
    }
    /**
     * 获取用户关注列表
     */
    public void onGetFollowList(int transactionId, List<User> userList){
    }
    /**
     * 关注成功
     */
    public void onFollow(int transactionId, String userId){
    }
    /**
     * 取消关注成功
     */
    public void onCancelFollow(int transactionId, String userId){
    }
    /**
     * 获取资讯源下资讯列表成功
     */
    public void onGetSourceInfoList(int transactionId, boolean hasMore, long maxTime){
    }
    /**
     * 获取主题下讨论列表成功
     */
    public void onGetSubjectInfoList(int transactionId, boolean hasMore){
    }
    /**
     * 修改用户信息成功
     */
    public void onUpdateUser(int transactionId){
    }
    /**
     * 获取用户动态id
     */
    public void onGetDynamicIds(int transactionId, Object[] dynamicListAndIds){
    }
    /**
     * 获取用户动态列表
     */
    public void onGetDynamicList(int transactionId, List<UserDynamic> dynamicList){
    }
    /**
     * 获取通知
     */
    public void onGetAdviceList(int transactionId, List<UserAdvice> dynamicList){
    }
    /**
     * 反馈官方资讯
     */
    public void onFeedBack1(int transactionId, Object obj) {
    }
    /**
     * 举报用户讨论
     */
    public void onReport(int transactionId, Object obj) {
    }
    /**
     * 发现讨论-最热
     * @return
     */
    public void onGetPopDiscussList(int transactionId) {
    }
    /**
     * 发现讨论-猜你喜欢
     * @return
     */
    public void onGetGuessDiscussList(int transactionId) {
    }
    /**
     * 获取话题下讨论
     * @param transactionId
     */
    public void onGetTopicDiscussList(int transactionId, boolean hasMore){
    }
    /**
     * 获取赞我的讨论
     * @param transactionId
     */
    public void onGetPraiseDiscussList(int transactionId, boolean hasMore, long maxTime){
    }
    /**
     * 获取用户发布的讨论
     * @param transactionId
     */
    public void onGetUserDiscussList(int transactionId, boolean hasMore, long maxTime){
    }

    /*************************************************************
     * error
     *************************************************************/
    /**
     * 登录失败
     */
    public void onLoginError(int transactionId, int errCode, String err) {
    }

    /**
     * 检查号码唯一性失败
     */
    public void onCheckPhoneNumberError(int transactionId, int errCode, String err) {
    }

    /**
     * 获取ID和密钥失败
     */
    public void onGetIdKeyError(int transactionId, int errCode, String err) {
    }

    /**
     * 获取资讯头条推荐失败
     */
    public void onHeadRecommendError(int transactionId, int errCode, String err) {
    }

    /**
     * 获取输入提示关注用户列表失败
     */
    public void onUserInputTipListError(int transactionId, int errCode, String err) {
    }

    /**
     * 获取输入提示订阅资讯源列表失败
     */
    public void onSourceInputTipListError(int transactionId, int errCode, String err) {
    }

    /**
     * 获取输入提示热门话题列表失败
     */
    public void onTopicInputTipListError(int transactionId, int errCode, String err) {
    }

    /**
     * 获取输入提示订阅主题列表失败
     */
    public void onSubjectInputTipListError(int transactionId, int errCode, String err) {
    }

    /**
     * 环回失败
     */
    public void onLoopBackError(int transactionId, int errCode, String err) {
    }

    /**
     * 获取主题列表失败
     */
    public void onGetSubjectListError(int transactionId, int errCode, String err){
    }
    /**
     * 获取手机验证码失败
     */
    public void onGetCaptchaError(int transactionId, int errCode, String err) {
    }
    /**
     * 修改手机登录密码失败
     */
    public void onModifyCellPhonePwError(int transactionId, int errCode, String err) {
    }
    /**
     * 注销失败
     */
    public void onLogoutError(int transactionId, int errCode, String err) {
    }
    /**
     * 图片，视频，音频上传失败
     */
    public void onUploadError(int transactionId, int errCode, String err) {
    }

    /**
     * 发表讨论失败
     */
    public void onPostDiscussError(int transactionId, int errCode, String err) {
    }

    /**
     * 评论资讯失败
     */
    public void onCommentInfoError(int transactionId, int errCode, String err) {
    }

    /**
     * 转发资讯失败
     */
    public void onForwardInfoError(int transactionId, int errCode, String err) {
    }

    /**
     * 搜索主题和资讯源失败
     */
    public void onSearchSubjectAndSourceError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取最新资讯源失败
     */
    public void onGetLatestSourceListError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取最热主题列表失败
     */
    public void onGetHotestSubjectListError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取推荐主题列表失败
     */
    public void onGetRecommedSubjectListError(int transactionId, int errCode, String err) {
    }
    /**
     * 批量获取资讯ID失败
     */
    public void onGetInfoIdsError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取主题详情失败
     */
    public void onGetSubjectDetailError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取资讯源详情失败
     */
    public void onGetSourceDetailError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取资讯列表
     */
    public void onGetInfoListError(int transactionId, int errCode, String err) {
    }
    /**
     * 上传反馈日志失败
     */
    public void onPostLogError(int transactionId, int errCode, String err){

    }
    /**
     * 反馈失败
     */
    public void onFeedBackError(int transactionId, int errCode, String err){

    }

    /**
     * 订阅失败
     */
    public void onSubscribeError(int transactionId, int errCode, String err){

    }

    /**
     * 取消订阅失败
     */
    public void onUnsubscribeError(int transactionId, int errCode, String err){

    }
    /**
     * 获取资讯正文失败
     */
    public void onInfoDetailError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取资讯评论，转发，赞失败
     */
    public void onInfoCfpError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取应用设置参数失败
     */
    public void onGetAppSettingError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取用户订阅的主题失败
     */
    public void onGetSubscribeSubjectListError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取推荐失败
     */
    public void onGetRecommError(int transactionId, int errCode, String err) {
    }

    /**
     * 获取未读资讯条数失败
     */
    public void onGetUnReadInfoCountError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取版本信息失败
     */
    public void onGetVersionInfoError(int transactionId, int errCode, String err) {
    }
    /**
     * 赞资讯失败
     */
    public void onPraiseInfoError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取人气榜用户失败
     */
    public void onGetPopFriendsListError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取猜你喜欢的用户失败
     */
    public void onGetGuessFriendsListError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取热门话题失败
     */
    public void onGetTopicListError(int transactionId, int errCode, String err) {
    }

    /**
     * 获取用户信息失败
     */
    public void onGetUserDetailError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取用户粉丝列表失败
     */
    public void onGetFansListError(int transactionId, int errCode, String err){
    }
    /**
     * 获取用户关注列表失败
     */
    public void onGetFollowListError(int transactionId, int errCode, String err){
    }
    /**
     * 当出现用户名密码错误、帐号锁定、第三方验证失败等异常时回调该方法
     */
    public void onAccException(int transactionId, int errCode, String err){
    }
    /**
     * 关注失败
     */
    public void onFollowError(int transactionId, int errCode, String err){
    }
    /**
     * 取消关注失败
     */
    public void onCancelFollowError(int transactionId, int errCode, String err){
    }
    /**
     * 获取资讯源下资讯列表失败
     */
    public void onGetSourceInfoListError(int transactionId, int errCode, String err){
    }
    /**
     * 获取主题下讨论列表失败
     */
    public void onGetSubjectInfoListError(int transactionId, int errCode, String err){
    }
    /**
     * 修改用户信息失败
     */
    public void onUpdateUserError(int transactionId, int errCode, String err){
    }
    /**
     * 获取用户动态id失败
     */
    public void onGetDynamicIdsError(int transactionId, int errCode, String err){
    }
    /**
     * 获取用户动态列表失败
     */
    public void onGetDynamicListError(int transactionId, int errCode, String err){
    }
    /**
     * 获取通知失败
     */
    public void onGetAdviceListError(int transactionId, int errCode, String err){
    }
    /**
     * 反馈官方资讯
     */
    public void onFeedBack1Error(int transactionId, int errCode, String err){
    }
    /**
     * 举报用户讨论
     */
    public void onReportError(int transactionId, int errCode, String err){
    }
    /**
     * 发现讨论-最热
     * @return
     */
    public void onGetPopDiscussListError(int transactionId, int errCode, String err) {
    }
    /**
     * 发现讨论-猜你喜欢
     * @return
     */
    public void onGetGuessDiscussListError(int transactionId, int errCode, String err) {
    }
    /**
     * 获取话题下讨论失败
     * @param transactionId
     */
    public void onGetTopicDiscussListError(int transactionId, int errCode, String err){
    }
    /**
     * 获取话题下讨论失败
     * @param transactionId
     */
    public void onGetPraiseDiscussListError(int transactionId, int errCode, String err){
    }
    /**
     * 获取用户发布的讨论
     * @param transactionId
     */
    public void onGetUserDiscussListError(int transactionId, int errCode, String err){
    }

    /*************************************************************
     *
     *
     *************************************************************/
    Handler mHandler;

    public XoneCallBack() {
        // mHandler = new InternalHandler();
    }

    public void onError(int type, int transactionId, int errCode, String errStr) {
        switch (type) {
            case XoneBaseTransaction.TRANSACTION_TYPE_LOGIN:
            case XoneBaseTransaction.TRANSACTION_TYPE_URS_USER_REG:
            case XoneBaseTransaction.TRANSACTION_TYPE_EXTERNAL_USER_REG:
            case XoneBaseTransaction.TRANSACTION_TYPE_CELLPHONE_REG:
                onLoginError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_CHECK_PHONENUMBER:
                onCheckPhoneNumberError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETIDKEY:
                onGetIdKeyError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_HEAD_RECOMMEND:
                onHeadRecommendError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_USERINPUTTIPLIST:
                onUserInputTipListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_LOOPBACK:
                onLoopBackError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SUBJECT_LIST:
                onGetSubjectListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_CELLPHONE_CAPTCHA:
                onGetCaptchaError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_MODIFY_CELLPHONE_PW:
                onModifyCellPhonePwError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_LOGOUT:
                onLogoutError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_UPLOAD:
                onUploadError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_POSTDISCUSS:
                onPostDiscussError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_SEARCH_SUBJECT_AND_SOURCE:
                onSearchSubjectAndSourceError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_LATEST_SOURCE_LIST:
                onGetLatestSourceListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_HOTEST_SUBJECT_LIST:
                onGetHotestSubjectListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_RECOMMEND_SUBJECT_LIST:
                onGetRecommedSubjectListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETINFOIDS:
                onGetInfoIdsError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SUBJECT_DETAIL:
                onGetSubjectDetailError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETINFOLIST:
                onGetInfoListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_POSTLOG:
                onPostLogError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SOURCE_DETAIL:
                onGetSourceDetailError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_FEEDBACK:
                onFeedBackError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_SUBSCRIBE:
                onSubscribeError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_UNSUBSCRIBE:
                onUnsubscribeError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETINFODETAIL:
                onInfoDetailError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETINFOCFP:
                onInfoCfpError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_APP_SETTING:
                onGetAppSettingError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SUBSCRIBE_LIST:
                onGetSubjectDetailError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_RECOMM_APP:
                onGetRecommError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETUNREADINFOCOUNT:
                onGetUnReadInfoCountError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_CHECK_VERSION:
                onGetVersionInfoError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_PRAISEINFO:
                onPraiseInfoError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_POP_FRIEND_LIST:
                onGetPopFriendsListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_TOPIC_LIST:
                onGetTopicListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_USER_DETAIL:
                onGetUserDetailError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_FANS_LIST:
                onGetFansListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_FOLLOW_LIST:
                onGetFollowListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_FOLLOW:
                onFollowError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_CANCEL_FOLLOW:
                onCancelFollowError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SOURCE_INFO_LIST:
                onGetSourceInfoListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SUBJECT_INFO_LIST:
                onGetSubjectInfoListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_UPDATE_USER:
                onUpdateUserError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_DYNAMIC_IDS:
                onGetDynamicIdsError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_DYNAMIC_LIST:
                onGetDynamicListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_ADVICE_LIST:
                onGetAdviceListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_FEEDBACK_1:
                onFeedBack1Error(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_REPORT:
                onReportError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_GUESS_FRIEND_LIST:
                onGetGuessFriendsListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_COMMENTINFO:
                onCommentInfoError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_FORWARDINFO:
                onForwardInfoError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_POP_DISCUSS_LIST:
                onGetPopDiscussListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_GUESS_DISCUSS_LIST:
                onGetGuessDiscussListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_TOPIC_INFO_LIST:
                onGetTopicDiscussListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_PRAISE_DISCUSS_LIST:
                onGetPraiseDiscussListError(transactionId, errCode, errStr);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_USER_DISCUSS_LIST:
                onGetUserDiscussListError(transactionId, errCode, errStr);
                break;
        }

        switch(errCode){
            case XoneServiceCode.LOGINREG_ERR_ACC_PW_ERROR:
            case XoneServiceCode.LOGINREG_ERR_USER_LOCKED:
            case XoneServiceCode.LOGINREG_ERR_EXTERNAL_VERIFY_ERROR:
                onAccException(transactionId, errCode, errStr);
            break;

        }
    }

    public void onSuccess(int type, int transactionId, int code, Object obj) {
        switch (type) {
            case XoneBaseTransaction.TRANSACTION_TYPE_LOGIN:
            case XoneBaseTransaction.TRANSACTION_TYPE_URS_USER_REG:
            case XoneBaseTransaction.TRANSACTION_TYPE_EXTERNAL_USER_REG:
            case XoneBaseTransaction.TRANSACTION_TYPE_CELLPHONE_REG:
                onLogin(transactionId, (User)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_CHECK_PHONENUMBER:
                onCheckPhoneNumber(transactionId, (Boolean)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETIDKEY:
                onGetIdKey(transactionId);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_HEAD_RECOMMEND:
                onHeadRecommend(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_USERINPUTTIPLIST:
                onUserInputTipList(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_LOOPBACK:
                onLoopBack(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SUBJECT_LIST:
                onGetSubjectList(transactionId, (List<Subject>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_CELLPHONE_CAPTCHA:
                onGetCaptcha(transactionId, (String)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_MODIFY_CELLPHONE_PW:
                onModifyCellPhonePw(transactionId);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_LOGOUT:
                onLogout(transactionId);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_UPLOAD:
                onUpload(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_POSTDISCUSS:
                onPostDiscuss(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_SEARCH_SUBJECT_AND_SOURCE:
                onSearchSubjectAndSource(transactionId, (List<Object>)obj);
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_LATEST_SOURCE_LIST:
                onGetLatestSourceList(transactionId, (List<Source>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_HOTEST_SUBJECT_LIST:
                onGetHotestSubjectList(transactionId, (List<Subject>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_RECOMMEND_SUBJECT_LIST:
                onGetRecommedSubjectList(transactionId, (List<Subject>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETINFOIDS:
                onGetInfoIds(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SUBJECT_DETAIL:
                onGetSubjectDetail(transactionId, (Subject)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETINFOLIST:
                onGetInfoList(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_SYNC_BIND_ACCOUNT:
                onBindingAccSync(transactionId);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_POSTLOG:
                onPostLog(transactionId, (String)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SOURCE_DETAIL:
                onGetSourceDetail(transactionId, (Source)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_FEEDBACK:
                onFeedBack(transactionId);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_SUBSCRIBE:
                onSubscribe(transactionId, (int[])obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_UNSUBSCRIBE:
                onUnsubscribe(transactionId, Integer.valueOf(obj.toString()));
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETINFODETAIL:
                onInfoDetail(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETINFOCFP:
                onInfoCfp(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_APP_SETTING:
                onGetAppSetting(transactionId);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SUBSCRIBE_LIST:
                onGetSubscribeSubjectList(transactionId, (List<Subject>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_RECOMM_APP:
                onGetRecomm(transactionId,(List<RecommAppInfo>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GETUNREADINFOCOUNT:
                onGetUnReadInfoCount(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_CHECK_VERSION:
                onGetVersionInfo(transactionId, (CheckVersionInfo)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_PRAISEINFO:
                onPraiseInfo(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_POP_FRIEND_LIST:
                onGetPopFriendsList(transactionId, (List<User>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_TOPIC_LIST:
                onGetTopicList(transactionId, (List<TopicVO>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_USER_DETAIL:
                onGetUserDetail(transactionId, (User)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_FANS_LIST:
                onGetFansList(transactionId, (List<User>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_FOLLOW_LIST:
                onGetFollowList(transactionId, (List<User>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_FOLLOW:
                onFollow(transactionId, (String)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_CANCEL_FOLLOW:
                onCancelFollow(transactionId, (String)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SOURCE_INFO_LIST:
                Object[] sourceInfodata = (Object[])obj;
                onGetSourceInfoList(transactionId, Boolean.valueOf(sourceInfodata[0].toString()), Long.valueOf(sourceInfodata[1].toString()));
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_SUBJECT_INFO_LIST:
                onGetSubjectInfoList(transactionId, Boolean.valueOf(obj.toString()));
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_UPDATE_USER:
                onUpdateUser(transactionId);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_DYNAMIC_IDS:
                onGetDynamicIds(transactionId, (Object[])obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_DYNAMIC_LIST:
                onGetDynamicList(transactionId, (List<UserDynamic>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_ADVICE_LIST:
                onGetAdviceList(transactionId, (List<UserAdvice>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_FEEDBACK_1:
                onFeedBack1(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_REPORT:
                onReport(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_GUESS_FRIEND_LIST:
                onGetGuessFriendsList(transactionId, (List<User>)obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_COMMENTINFO:
                onCommentInfo(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_FORWARDINFO:
                onForwardInfo(transactionId, obj);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_POP_DISCUSS_LIST:
                onGetPopDiscussList(transactionId);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_GUESS_DISCUSS_LIST:
                onGetGuessDiscussList(transactionId);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_TOPIC_INFO_LIST:
                onGetTopicDiscussList(transactionId, Boolean.valueOf(obj.toString()));
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_PRAISE_DISCUSS_LIST:
                Object[] priaseData = (Object[])obj;
                boolean hasMore = (Boolean)priaseData[0];
                long maxTime = (Long)priaseData[1];
                onGetPraiseDiscussList(transactionId, hasMore, maxTime);
                break;
            case XoneBaseTransaction.TRANSACTION_TYPE_GET_USER_DISCUSS_LIST:
                Object[] userDiscussData = (Object[])obj;
                boolean userHasMore = (Boolean)userDiscussData[0];
                long userMaxTime = (Long)userDiscussData[1];
                onGetUserDiscussList(transactionId, userHasMore, userMaxTime);
                break;
        }
    }
    // public void callError(int type, int transactionId, int errCode, String
    // errStr){
    // mHandler.obtainMessage(TRANSACTION_ERROR, type, transactionId, new
    // Object[]{errStr, Integer.valueOf(errCode)}).sendToTarget();
    // }
    //
    // public void callSuccess(int type, int transactionId, Object obj){
    // mHandler.obtainMessage(TRANSACTION_SUCCESS, type, transactionId,
    // obj).sendToTarget();
    // }

    // private static final int TRANSACTION_ERROR = 0x1;
    // private static final int TRANSACTION_SUCCESS = 0x2;
    // private class InternalHandler extends Handler {
    // @Override
    // public void handleMessage(Message msg) {
    // switch(msg.what){
    // case TRANSACTION_ERROR:
    // onError(msg.arg1, msg.arg2, (Integer)((Object[])msg.obj)[1],
    // (String)((Object[])msg.obj)[0]);
    // break;
    //
    // case TRANSACTION_SUCCESS:
    // onSuccess(msg.arg1, msg.arg2, msg.obj);
    // break;
    //
    // }
    // super.handleMessage(msg);
    // }
    // }

}
